<?php
use app\assets\AppAsset;
use yii\helpers\Url;
AppAsset::register($this);
$this->registerCssFile('@web/css/sqwrite.css',['depends'=>['app\assets\AppAsset']]);
$this->registerJSFile('@web/js/time.js',['depends'=>['app\assets\AppAsset']]);
$this->registerJSFile('@web/js/writecum.js',['depends'=>['app\assets\AppAsset']]);

?>
<script type="text/javascript">
	<?php
	$session=Yii::$app->session;
	$session->open();
	?>
    var current_userid=<?=$session['user_id'];?>;
	var que_info={
		class1:'<?=$write_content['class1_id'];?>',
		class2:'<?=$write_content['class2_id'];?>',
		question:'<?=$write_content['id'];?>',
		tnum:'0'
	};
</script>
<div class="container" xmlns="http://www.w3.org/1999/html">
	<div class="total-info">
		<span>
			<?=$write_content['class_name'];?>
			TPO
			<?=$write_content['class_num'];?>
		</span>
	</div>
	<div class="total-part">
		<div class="total-lead clearfix">
			<span class="top-que pull-left">
			TPO <?=$write_content['class_num'];?>
                <?=$write_content['class_name'];?>
                Question
                <?=$write_content['tnum'];?>
			</span>
			<?php
			$session=Yii::$app->session;
			$session->open();
			if($write_person)
			{
				?>
				<span class="time pull-left">
					<?php
					$session=Yii::$app->session;
					$session->open();
					$session['begin_time'];
					$now=time();
					$session['begin_end_time']=$now-$session['begin_time'];
					?>
					练习耗时: <span id="cost-time"><?=$write_person['time'];?></span>
				</span>
				<span class="repeat-doit pull-right">
					<i class="fa fa-rotate-left"></i>
					&nbsp;&nbsp;<a href="<?= Url::to('@web/?r=writing/index&id='.$write_content['id']); ?>">重做本篇</a>
				</span>
				<?php
			}
			?>
		</div>
		<div class="main-part clearfix">
			<div class="col-xs-5 users">
				<p class="dir-que">
					Directions:You have 30 minutes to plan and write your response.Yourresponse will be judged on the basis of the quality of your writing and on how well your response presents the points in the lecture and their relationship to the reading passage.Typically an effective response will be 300 words at least.
				</p>
				<div class="main-que">
					<p class="total-que">question<br>
						<span class="main-lead-que">
							<?=$write_content['question'];?>
						</span>
					</p>
				</div>
				<div class="hot-voice">
					<div class="hot-lead"><i class="fa fa-fire"></i>&nbsp;&nbsp;热门题解</div>
					<div class="add-more">
						<span>加载更多</span>
					</div>
				</div>
			</div>
			<div class="col-xs-7 ques">
				<div class="word-count">
					<span>word count: <span id="countnum">391</span></span>
				</div>
					<div class="userwrite-text">
						<div class="user-write clearfix">
							<div class="my-record">
								<span>我的题解</span>
							</div>
							<div class="record-text">
								<div id="user-composition" class="user-composition" contenteditable="true">
									<?= \yii\helpers\HtmlPurifier::process($write_person_content2['content']); ?>
								</div>
							</div>
							<?php
							if($write_person) {
								?>
								<div class="share pull-right">
									分享 <span>Share</span>
								</div>
								<span id="comment-succeed">
									<img src="<?=Url::to('@web/images/updating.gif');?>" alt="上传中...">
									<span>updating...</span>
								</span>
								<?php
							}
							?>
						</div>
					</div>
			</div>
		</div>
	</div>
</div>
<div class="hidden" id="voicemodel">
	<div class="user-lead clearfix">
		<div class="user-info pull-left clearfix">
			<div class="user-pic pull-left">
				<img src="<?=Url::to('@web/images/timg.jpg');?>">
			</div>
			<div class="user-id-date pull-left">
				<span class="user-id"></span><br>
				<span class="user-date"></span>
			</div>
		</div>
		<div class="good-times pull-right" title="点赞量">
			<span><i class="fa fa-thumbs-o-up"></i>&nbsp;&nbsp;<span class="goods">398</span></span>
		</div>
		<div class="view-times pull-right" title="浏览量">
			<span><i class="fa fa-eye"></i>&nbsp;&nbsp;<span class="views">333</span></span>
		</div>
	</div>
	<div class="user-comments">
		<span class="usercomment"></span>
		<div class="allchart">
			<div class="chartone">
				文章总观点:&nbsp;&nbsp;<span></span>
				<ul>
					<li>第一方面:&nbsp;&nbsp;<span></span></li>
					<li>第二方面:&nbsp;&nbsp;<span></span></li>
					<li>第三方面:&nbsp;&nbsp;<span></span></li>
				</ul>
			</div>
			<div class="charttwo">
				听力总观点:&nbsp;&nbsp;<span></span>
				<ul>
					<li>第一方面:&nbsp;&nbsp;<span></span></li>
					<li>第二方面:&nbsp;&nbsp;<span></span></li>
					<li>第三方面:&nbsp;&nbsp;<span></span></li>
				</ul>
			</div>
		</div>
	</div>
	<div class="view-all center-block">点击查看全文</div>
</div>
<script type="text/javascript">
	window.onload=function() {
		<?php
		$session=Yii::$app->session;
		$session->open();
		?>
		$('#cost-time').html(secToMin(<?=$write_person['time'];?>));
	};
</script>